package com.panda.web.mapper.commons;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panda.common.core.domain.AjaxResult;
import com.panda.web.entity.commons.SearchContent;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SearchContentMapper extends BaseMapper<SearchContent> {
    @Select("select  * from search_content where openid =#{openid}")
    List<SearchContent> findByOpenid(String openid);
    @Delete("delete from search_content where openid =#{openid}")
    int deleteByOpenid(String openid);
    @Select("select count(*) from search_content where openid =#{openid} and content =#{content}")
    int findByOpenidAndContent(@Param("openid") String openid,@Param("content") String content);
}
